/*jslint */
/*global extend, Class, Request */

/**
 * Класс ответа сервиса.
 *
 * @public
 * @function
 * @name Response
 * @extends Class
 */
var Response = Class.$extend({

    request : null,

    response : null,

    $init : function (request, response) {
        'use strict';
        if (!(request instanceof Request)) {
            throw new TypeError('Request is not a valid.');
        }
        this.request = request;
        if (response instanceof Response) {
            this.response = response.getData();
        } else {
            this.response = extend({}, response);
        }
    }

});